<template>
  <div class="box">
    <van-nav-bar
        title="订单查看"
        left-text=""
        right-text=""
        left-arrow
        @click-left="goback"
      > 
    </van-nav-bar>
    <van-tabs v-model="active">
  <van-tab title="全部订单"><ul>
      <li v-for="(lists,index) in glist" :key="index" @click="goGoodsDetail(lists.proid)">
        <div class="tu">
          <img :src="lists.img1">
        </div>
        <div class="zi">
          <p class="p1">{{lists.proname}}</p>
          <p class="p2"><span>￥</span>{{lists.originprice}}</p>
        </div>
      </li>
    </ul></van-tab>
  <van-tab title="待付款">待付款</van-tab>
  <van-tab title="待收货">待收货</van-tab>
  <van-tab title="待评价">待评价</van-tab>
</van-tabs>
    <div>
      
    </div>
  </div>
</template>

<script>


export default {
      name:"SeeMenu",
      data(){
        return {
          active:'',
          glist:{}
        }
      },
      methods:{
        goback(){
          this.$router.go(-1)
        }

      },
      created(){
      let token = localStorage.getItem("token");
      console.log('token: ', token);
      let userid = localStorage.getItem("userid");
      console.log('userid: ', userid);

        this.$service({
          method:'get',
          url:"/api/user/orderlist",
          headers:{token},
          params:{userid}

        })
        .then(res=>{
          this.glist = res.data.data
          console.log(res);
          console.log(this.glist);
        })
      }
}
</script>

<style scoped>
li{
    width: 100%;
    height: 6.25rem;
    background: white;
  }
  .tu{
    height: 6.25rem;
    width: 6.25rem;
    float: left;

  }

  img{
    width: 5.5rem;
    height: 5.5rem;
    border-radius:0.625rem ;
    margin-top: 0.375rem;
    margin-left:0.625rem ;


  }
  .zi{
    height: 5.5rem;
    width: 15.625rem;
    float: left;
    margin-left:0.625rem ;
    padding: 0.375rem 0 ;
  }
  .p1{
    float: right;
    font-size: 0.75rem;
  }
  .p2{
    margin-top: 4.375rem;
  }
  span{
    font-size: 0.75rem;
    
  }

</style>